import moment from "moment";
import { orderStatus } from 'utils';
const repeatCheckClomns = [
    {title: '订单号', dataIndex: 'orderNo', key: 'orderNo'},
    // {title: '产品类型', dataIndex: 'deviceModel', key: 'deviceModel'},
    {title: '姓名', dataIndex: 'userTrueName', key: 'userTrueName'},
    {title: '手机号', dataIndex: 'userPhone', key: 'userPhone'},
    {
        title: '是否是老用户',
        dataIndex: 'isOlduser',
        key: 'isOlduser',
        render(text){
            return Number(text) === 0 ? '否' : '是';
        }
    },
    {title: '正常还款金额(元)', dataIndex: 'deviceMoney', key: 'deviceMoney'},
    {title: "申请金额(元)", dataIndex: "lendMoney", key: "lendMoney"},
    {title: "借款期限(天)", dataIndex: "lendDays", key: "lendDays"},
    {
        title: "手续费(元)",
        dataIndex: "serviceMoney",
        key: "serviceMoney",
        // render(text, record) {
        //     const {deviceMoney = 0} = record;
        //     const res = Number(deviceMoney) * 0.2;
        //     return Number.isInteger(res) ? res : res.toFixed(2);
        // }
        render(text, record) {
            const {deviceMoney, lendMoney } = record;
            const res = (Number(deviceMoney)*10) - (Number(lendMoney)*10);
            const resNum = res/10
            // return Number.isInteger(res) ? res : res.toFixed(2);
            return resNum;
        }
    },
    {
        title: '申请时间',
        dataIndex: 'applyTime',
        key: 'applyTime',
        render(text) {
            return moment(Number(text) * 1000).format('YYYY-MM-DD HH:mm:ss');
        }
    },
    {title: '渠道来源', dataIndex: 'channelId', key: 'channelId'},
    // {title: '审核员', dataIndex: 'examiner2Id', key: 'examiner2Id'},
    {
        title: '状态',
        dataIndex: 'status',
        key: 'status',
        render(text) {
            return orderStatus[text];
        }
    },
]
export { repeatCheckClomns }